/**
 * Created by ospip on 2017/11/14.
 * Copyright (c) 2017 LLAP. All rights reserved.
 */
public class BallThread extends Thread {
    private Ball b;

    public BallThread(Ball ball) {
        this.b = ball;
    }

    @Override
    public void run() {
        while(true) {
            try {
                b.update();
                if (b.x - b.radius > b.borderx) return;
                sleep(10);
            }
            catch (Exception e) {}
        }
    }
}
